﻿using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using SmartCity.Shared;
using Volo.Abp;
using Volo.Abp.AspNetCore.Mvc;

namespace CommonManagement
{
    /// <summary>
    /// 地理位置控制器
    /// </summary>
    [RemoteService]
    [Area("commonManagement")]
    [Route("api/commonManagement/gps")]
    public class LocationController : AbpController, ILocationAppService
    {
        private readonly ILocationAppService _locationAppService;

        public LocationController(
            ILocationAppService locationAppService)
        {
            _locationAppService = locationAppService;
        }

        // 1.8.3 获取当前地理位置
        [HttpGet]
        [Route("location")]
        public Task<ResultResponse<LocationDto>> GetAsync()
        {
            return _locationAppService.GetAsync();
        }
    }
}